package org.vehicle.vo;

import java.io.Serializable;
import java.util.HashMap;

public class ListDataSource implements Serializable{
	private Integer page;
	private Integer pageSize;
	private HashMap<String,String> data;
	private HashMap<String,Object> objs;
	
	public void addObjData(String field,Object value){
		objs.put(field, value);
	}
	public void addData(String field,String value){
		data.put(field, value);
	}
	
	public String getValue(String field){
		return data.get(field);
	}
	public Object getObjValue(String field){
		return objs.get(field);
	}
	
	public ListDataSource(int page, int pageSize) {
		this.page = page;
		this.pageSize = pageSize;
		data=new HashMap<String,String>();
	}
	/**
	 * 
	 * @param page
	 * @param pageSize
	 * @param con 实例化Object的map的开关，true为实例化Object
	 */
	public ListDataSource(int page, int pageSize,Boolean con) {
		this.page = page;
		this.pageSize = pageSize;
		if(con) objs=new HashMap<String,Object>();
		else data=new HashMap<String,String>();
	}
	public ListDataSource() {
		data=new HashMap<String,String>();
	}
	public ListDataSource(Boolean con) {
		if(con) objs=new HashMap<String,Object>();
		else data=new HashMap<String,String>();
	}
	public Integer getPage() {
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public HashMap<String, String> getData() {
		return data;
	}
	public void setData(HashMap<String, String> data) {
		this.data = data;
	}
	public HashMap<String, Object> getObjs() {
		return objs;
	}
	public void setObjs(HashMap<String, Object> objs) {
		this.objs = objs;
	}
}
